
using System;

namespace BeeTest
{
	public class GivenState<T0, T1, T2, T3, T4>
	{
		#region Fields & Properties

		internal T0 state0;
		internal T1 state1;
		internal T2 state2;
		internal T3 state3;
		internal T4 state4;

		public AndGivenState<T0, T1, T2, T3, T4> And
		{
			get
			{
				return new AndGivenState<T0, T1, T2, T3, T4>(this.state0, this.state1, this.state2, this.state3, this.state4);
			}
		}

		#endregion


		#region Constructors

		public GivenState(T0 s0, T1 s1, T2 s2, T3 s3, T4 s4)
		{
			this.state0 = s0;
			this.state1 = s1;
			this.state2 = s2;
			this.state3 = s3;
			this.state4 = s4;
		}

		#endregion


		#region Operations

		public WhenState<T0, T1, T2, T3, T4> When(Action<T0, T1, T2, T3, T4> whenFunc)
		{
			try
			{
				whenFunc(this.state0, this.state1, this.state2, this.state3, this.state4);
				return new WhenState<T0, T1, T2, T3, T4>(this.state0, this.state1, this.state2, this.state3, this.state4);
			}
			catch(Exception exc)
			{
				return new WhenState<T0, T1, T2, T3, T4>(exc);
			}
		}


		public WhenState<T0, T1, T2, T3, T4> When<TP0>(Action<T0, T1, T2, T3, T4, TP0> whenFunc, TP0 arg0)
		{
			try
			{
				whenFunc(this.state0, this.state1, this.state2, this.state3, this.state4, arg0);
				return new WhenState<T0, T1, T2, T3, T4>(this.state0, this.state1, this.state2, this.state3, this.state4);
			}
			catch(Exception exc)
			{
				return new WhenState<T0, T1, T2, T3, T4>(exc);
			}
		}


		public WhenState<T0, T1, T2, T3, T4> When<TP0, TP1>(Action<T0, T1, T2, T3, T4, TP0, TP1> whenFunc, TP0 arg0, TP1 arg1)
		{
			try
			{
				whenFunc(this.state0, this.state1, this.state2, this.state3, this.state4, arg0, arg1);
				return new WhenState<T0, T1, T2, T3, T4>(this.state0, this.state1, this.state2, this.state3, this.state4);
			}
			catch(Exception exc)
			{
				return new WhenState<T0, T1, T2, T3, T4>(exc);
			}
		}


		public WhenState<T0, T1, T2, T3, T4> When<TP0, TP1, TP2>(Action<T0, T1, T2, T3, T4, TP0, TP1, TP2> whenFunc, TP0 arg0, TP1 arg1, TP2 arg2)
		{
			try
			{
				whenFunc(this.state0, this.state1, this.state2, this.state3, this.state4, arg0, arg1, arg2);
				return new WhenState<T0, T1, T2, T3, T4>(this.state0, this.state1, this.state2, this.state3, this.state4);
			}
			catch(Exception exc)
			{
				return new WhenState<T0, T1, T2, T3, T4>(exc);
			}
		}


		public WhenState<T0, T1, T2, T3, T4> When<TP0, TP1, TP2, TP3>(Action<T0, T1, T2, T3, T4, TP0, TP1, TP2, TP3> whenFunc, TP0 arg0, TP1 arg1, TP2 arg2, TP3 arg3)
		{
			try
			{
				whenFunc(this.state0, this.state1, this.state2, this.state3, this.state4, arg0, arg1, arg2, arg3);
				return new WhenState<T0, T1, T2, T3, T4>(this.state0, this.state1, this.state2, this.state3, this.state4);
			}
			catch(Exception exc)
			{
				return new WhenState<T0, T1, T2, T3, T4>(exc);
			}
		}


		public WhenState<T0, T1, T2, T3, T4> When<TP0, TP1, TP2, TP3, TP4>(Action<T0, T1, T2, T3, T4, TP0, TP1, TP2, TP3, TP4> whenFunc, TP0 arg0, TP1 arg1, TP2 arg2, TP3 arg3, TP4 arg4)
		{
			try
			{
				whenFunc(this.state0, this.state1, this.state2, this.state3, this.state4, arg0, arg1, arg2, arg3, arg4);
				return new WhenState<T0, T1, T2, T3, T4>(this.state0, this.state1, this.state2, this.state3, this.state4);
			}
			catch(Exception exc)
			{
				return new WhenState<T0, T1, T2, T3, T4>(exc);
			}
		}


		#endregion
	}
}

